<template>
  <router-link to="/hide">to hide</router-link>

  <div class="login-container">
    <el-form class="login-form" @submit.native.prevent="submitForm">
      <el-form-item label="用户名">
        <el-input v-model="username" placeholder="请输入用户名"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input type="password" v-model="password" placeholder="请输入密码"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button class="login-button" type="primary" native-type="submit">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { ref } from 'vue';

let username = ref('');
let password = ref('');

const submitForm = () => {
  console.log(`Username: ${username.value}, Password: ${password.value}`);
  // 在这里添加你的登录逻辑
};
</script>

<style scoped>
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f2f2f2;
}

.login-form {
  width: 300px;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  border-radius: 5px;
}

.login-button {
  width: 100%;
}
</style>
